package Javatest;

public class test1 {
    public static void main(String[] args) {
        int num1 = 10;
        int num2 = 3;

        try {
            int result = divide(num1, num2);
            System.out.println("结果: " + result);
        } catch (ArithmeticException e) {
            System.out.println("捕获到异常: " + e.getMessage());
        }
    }

    public static int divide(int num1, int num2) {
        return num1 / num2;
    }
}
